package csel.model.items;

import csel.model.*;
import csel.model.entity.Entity;

public abstract class Item extends GameObject
{
	private static final long serialVersionUID = 7L;
	
	private Tile location;
	
	/**
	 * Informs the Item that the Entity has stepped on it.
	 * @return true if the item should be removed from the map
	 */
	public abstract boolean enter(Entity e);
	
	/**
	 * Informs the Item that the specified Entity has left the map.
	 */
	public abstract void leave(Entity e);
	
	public Item(String typeId)
	{
		super(typeId);	//TODO
	}
	
	public boolean canEnter(MobileObject obj, BlockNotifier notifier)
	{
		return true;
	}
	
	public boolean canLeave(MobileObject obj)
	{
		return true;
	}

	public Tile getLocation()
	{
		return location;
	}

	public void setLocation(Tile location)
	{
		this.location = location;
	}
	
	public boolean isVisible()
	{
		/* all items are true by default */
		return true;
	}
	
	//by default does nothing
	public void setIsVisible(boolean isVisible)
	{
		/* items are initially true by default */
	}
}
